import {BaseController} from 'egg-cool-controller';
import router from 'egg-cool-router';

/**
 * 应用通用控制器
 */
@router.prefix ('/wx/like')
export default class WxLikeController extends BaseController {
    /**
     * 点赞
     */
    @router.post ('/add')
    public async add () {
        this.res ({data : await this.service.goods.like.add (this.getBody ())});
    }

    /**
     * 取消点赞
     * */
    @router.post ('/cancel')
    public async cancel () {
        this.res ({data : await this.ctx.service.goods.like.cancel (this.getBody ())});
    }

    /**
     * 收藏列表
     * */
    @router.get ('/list')
    public async list () {
        this.res ({data : await this.ctx.service.goods.like.list ()});
    }

}
